﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;

namespace cooc.Properties
{
    static class Program
    {
        static Thread workthread = new Thread(Work);
        static DeamonServer instance;
        static void Main(string[] args)
        {
            workthread.Start();
            while (!DeamonServer.workstatus) { }
            while(DeamonServer.workstatus && workthread.IsAlive)
            {
                string cmd = Console.ReadLine();
                if (cmd.Equals("exit") || cmd.Equals("stop"))
                    instance.Stop();
                else if (cmd.Equals("status"))
                    instance.PrintStauts();
            }
        }

        static void Work()
        {
            instance = new DeamonServer(666);
            instance.Start();
        }
    }
}
